package com.riddle.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class JsonUtil {

	public static String toJson(Object obj) {
		try
		{
			Gson gson = new GsonBuilder()  
					  .setDateFormat("yyyy-MM-dd HH:mm")  
					  .create(); 
			return gson.toJson(obj);
		} catch(Exception ex) {
			ex.printStackTrace();
			throw ex;
		}
		
	}
}
